const app = getApp()

Page({
  data: {
    index: 1,
    list: []
  },
  onLoad: function (options) {
    this.getList(options.category)
  },
  async getList (category) {
    const res = await app.http.get('/api/v1/getShopList?pageNum=1&pageSize=999&category=' + category)
    if (res.code == 0) {
      this.setData({ list: res.data.list })
    } else {
      app.helper.msg(res.message)
      setTimeout(() => {
        wx.navigateBack({
          delta: 0,
        })
      }, 1500)
    }
  },
  handleClick (e) {
    wx.navigateTo({ url: '/pages/reports/reports?id=' + e.currentTarget.dataset.id })
  },
  onShareAppMessage: function () {

  }
})